package com.tanhua.server.interceptor;

import com.tanhua.model.domain.User;

/**
 * @author げっしょく
 * @date 2021/10/23
 */
public class UserHolder {
    private static final ThreadLocal<User> t = new ThreadLocal();

    public static void set(User user) {
        t.set(user);
    }

    public static User get() {
        return t.get();
    }

    public static Long getId() {
        return t.get().getId();
    }

    public static String getPhone() {
        return t.get().getMobile();
    }

    public static void remove() {
        t.remove();
    }
}
